﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;
using System.Collections;
public partial class zoushitu_dlt_dlt_hzzs : System.Web.UI.Page
{
    protected List<Model.LotteryAnnouncement> arlist = null;
    protected string[] SSQList = null;
    protected string SSQblue = null;
    protected DataTable dtPaperList = new DataTable();
    protected DataTable dtPaperList2 = new DataTable();
    protected int jinqiCount = 0;

    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            jinqiCount = 30;
            bindData(30);
        }
    }

    protected void bindData(int maxValue)
    {

        arlist = BLL.LotteryAnnouncement.getDatas(maxValue,2);

        if (arlist != null)
        {
            dtPaperList2.Columns.Add("Hezhi1", typeof(string));
            dtPaperList.Columns.Add("Hezhi1", typeof(string));
            dtPaperList.Columns.Add("Hezhi2", typeof(string));
            dtPaperList.Columns.Add("Hezhi3", typeof(string));
            dtPaperList.Columns.Add("Hezhi4", typeof(string));
            dtPaperList.Columns.Add("Hezhi5", typeof(string));
            dtPaperList.Columns.Add("Hezhi6", typeof(string));
            dtPaperList.Columns.Add("Hezhi7", typeof(string));
            dtPaperList.Columns.Add("Hezhi8", typeof(string));
            dtPaperList.Columns.Add("Hezhi9", typeof(string));
            dtPaperList.Columns.Add("Hezhi10", typeof(string));
            dtPaperList.Columns.Add("Hezhi11", typeof(string));
            dtPaperList.Columns.Add("Hezhi12", typeof(string));
            dtPaperList.Columns.Add("Hezhi13", typeof(string));
            dtPaperList.Columns.Add("Hezhi14", typeof(string));
            dtPaperList.Columns.Add("Hezhi15", typeof(string));
            dtPaperList.Columns.Add("Hezhi16", typeof(string));
            dtPaperList.Columns.Add("Hezhi17", typeof(string));
            dtPaperList.Columns.Add("Hezhi18", typeof(string));
            dtPaperList.Columns.Add("Hezhi19", typeof(string));
            dtPaperList.Columns.Add("Hezhi20", typeof(string));
            dtPaperList.Columns.Add("Hezhi21", typeof(string));
            dtPaperList.Columns.Add("Hezhi22", typeof(string));
            dtPaperList.Columns.Add("Hezhi23", typeof(string));
            dtPaperList.Columns.Add("Hezhi24", typeof(string));
            dtPaperList.Columns.Add("Hezhi25", typeof(string));
            dtPaperList.Columns.Add("Hezhi26", typeof(string));
            dtPaperList.Columns.Add("Hezhi27", typeof(string));

            //dtPaperList.Columns.Add("Hezhiw1", typeof(string));
            //dtPaperList.Columns.Add("Hezhiw2", typeof(string));
            //dtPaperList.Columns.Add("Hezhiw3", typeof(string));
            //dtPaperList.Columns.Add("Hezhiw4", typeof(string));
            //dtPaperList.Columns.Add("Hezhiw5", typeof(string));
            //dtPaperList.Columns.Add("Hezhiw6", typeof(string));
            //dtPaperList.Columns.Add("Hezhiw7", typeof(string));
            //dtPaperList.Columns.Add("Hezhiw8", typeof(string));
            //dtPaperList.Columns.Add("Hezhiw9", typeof(string));
            //dtPaperList.Columns.Add("Hezhiw10", typeof(string));

            for (int i = 0; i < arlist.Count; i++)
            {
                int hezhi = 0;//和值 
                string[] redBall = arlist[i].LotteryNo.Split('+')[0].Split(',');
                for (int m = 0; m < redBall.Length; m++)
                {

                    hezhi += int.Parse(redBall[m]);
                }
                //string[] bluBall = arlist[i].LotteryNo.Split('+')[1].Split(',');
                //for (int m = 0; m < bluBall.Length; m++)
                //{

                //    hezhi += int.Parse(bluBall[m]);
                //}
                //DataRow newRow = dtPaperList2.NewRow();
                //newRow["Hezhi1"] = hezhi.ToString();
                //dtPaperList2.Rows.Add(newRow);
                //绑定和值
                bindHezhi(hezhi, int.Parse(hezhi.ToString().Substring(hezhi.ToString().Length - 1, 1)));

                //计算条形图中每个数的个数
                bindTiaoxing(hezhi, int.Parse(hezhi.ToString().Substring(hezhi.ToString().Length - 1, 1)));
            }
        }
    }
    protected int[] hezhiDt = new int[25];
    /// <summary>
    /// 绑定和值 和值尾数到一个新的datatable
    /// </summary>
    /// <param name="data">和值</param>
    /// <param name="dataLast">和值尾数</param>
    protected void bindHezhi(int data, int dataLast)
    {
        DataRow newRow = dtPaperList.NewRow();
        if (data <= 40)
        {
            #region
            newRow["Hezhi1"] = data.ToString();
            newRow["Hezhi2"] = "0";
            newRow["Hezhi3"] = "0";
            newRow["Hezhi4"] = "0";
            newRow["Hezhi5"] = "0";
            newRow["Hezhi6"] = "0";
            newRow["Hezhi7"] = "0";
            newRow["Hezhi8"] = "0";
            newRow["Hezhi9"] = "0";
            newRow["Hezhi10"] = "0";
            newRow["Hezhi11"] = "0";
            newRow["Hezhi12"] = "0";
            newRow["Hezhi13"] = "0";
            newRow["Hezhi14"] = "0";
            newRow["Hezhi15"] = "0";
            newRow["Hezhi16"] = "0";
            newRow["Hezhi17"] = "0";
            newRow["Hezhi18"] = "0";
            newRow["Hezhi19"] = "0";
            newRow["Hezhi20"] = "0";
            newRow["Hezhi21"] = "0";
            newRow["Hezhi22"] = "0";
            newRow["Hezhi23"] = "0";
            newRow["Hezhi24"] = "0";
            newRow["Hezhi25"] = "0";
            newRow["Hezhi26"] = "0";
            newRow["Hezhi27"] = "0";
            #endregion
        }
        else if (data >= 41 && data < 46)
        {
            #region
            newRow["Hezhi2"] = data.ToString();
            newRow["Hezhi1"] = "0";
            newRow["Hezhi3"] = "0";
            newRow["Hezhi4"] = "0";
            newRow["Hezhi5"] = "0";
            newRow["Hezhi6"] = "0";
            newRow["Hezhi7"] = "0";
            newRow["Hezhi8"] = "0";
            newRow["Hezhi9"] = "0";
            newRow["Hezhi10"] = "0";
            newRow["Hezhi11"] = "0";
            newRow["Hezhi12"] = "0";
            newRow["Hezhi13"] = "0";
            newRow["Hezhi14"] = "0";
            newRow["Hezhi15"] = "0";
            newRow["Hezhi16"] = "0";
            newRow["Hezhi17"] = "0";
            newRow["Hezhi18"] = "0";
            newRow["Hezhi19"] = "0";
            newRow["Hezhi20"] = "0";
            newRow["Hezhi21"] = "0";
            newRow["Hezhi22"] = "0";
            newRow["Hezhi23"] = "0";
            newRow["Hezhi24"] = "0";
            newRow["Hezhi25"] = "0";
            newRow["Hezhi26"] = "0";
            newRow["Hezhi27"] = "0";
            #endregion
        }
        else if (data >= 46 && data < 51)
        {
            #region
            newRow["Hezhi3"] = data.ToString();
            newRow["Hezhi2"] = "0";
            newRow["Hezhi1"] = "0";
            newRow["Hezhi4"] = "0";
            newRow["Hezhi5"] = "0";
            newRow["Hezhi6"] = "0";
            newRow["Hezhi7"] = "0";
            newRow["Hezhi8"] = "0";
            newRow["Hezhi9"] = "0";
            newRow["Hezhi10"] = "0";
            newRow["Hezhi11"] = "0";
            newRow["Hezhi12"] = "0";
            newRow["Hezhi13"] = "0";
            newRow["Hezhi14"] = "0";
            newRow["Hezhi15"] = "0";
            newRow["Hezhi16"] = "0";
            newRow["Hezhi17"] = "0";
            newRow["Hezhi18"] = "0";
            newRow["Hezhi19"] = "0";
            newRow["Hezhi20"] = "0";
            newRow["Hezhi21"] = "0";
            newRow["Hezhi22"] = "0";
            newRow["Hezhi23"] = "0";
            newRow["Hezhi24"] = "0";
            newRow["Hezhi25"] = "0";
            newRow["Hezhi26"] = "0";
            newRow["Hezhi27"] = "0";
            #endregion
        }
        else if (data >= 51 && data < 56)
        {
            #region
            newRow["Hezhi4"] = data.ToString();
            newRow["Hezhi2"] = "0";
            newRow["Hezhi3"] = "0";
            newRow["Hezhi1"] = "0";
            newRow["Hezhi5"] = "0";
            newRow["Hezhi6"] = "0";
            newRow["Hezhi7"] = "0";
            newRow["Hezhi8"] = "0";
            newRow["Hezhi9"] = "0";
            newRow["Hezhi10"] = "0";
            newRow["Hezhi11"] = "0";
            newRow["Hezhi12"] = "0";
            newRow["Hezhi13"] = "0";
            newRow["Hezhi14"] = "0";
            newRow["Hezhi15"] = "0";
            newRow["Hezhi16"] = "0";
            newRow["Hezhi17"] = "0";
            newRow["Hezhi18"] = "0";
            newRow["Hezhi19"] = "0";
            newRow["Hezhi20"] = "0";
            newRow["Hezhi21"] = "0";
            newRow["Hezhi22"] = "0";
            newRow["Hezhi23"] = "0";
            newRow["Hezhi24"] = "0";
            newRow["Hezhi25"] = "0";
            newRow["Hezhi26"] = "0";
            newRow["Hezhi27"] = "0";
            #endregion
        }
        else if (data >= 56 && data < 61)
        {
            #region
            newRow["Hezhi5"] = data.ToString();
            newRow["Hezhi2"] = "0";
            newRow["Hezhi3"] = "0";
            newRow["Hezhi4"] = "0";
            newRow["Hezhi1"] = "0";
            newRow["Hezhi6"] = "0";
            newRow["Hezhi7"] = "0";
            newRow["Hezhi8"] = "0";
            newRow["Hezhi9"] = "0";
            newRow["Hezhi10"] = "0";
            newRow["Hezhi11"] = "0";
            newRow["Hezhi12"] = "0";
            newRow["Hezhi13"] = "0";
            newRow["Hezhi14"] = "0";
            newRow["Hezhi15"] = "0";
            newRow["Hezhi16"] = "0";
            newRow["Hezhi17"] = "0";
            newRow["Hezhi18"] = "0";
            newRow["Hezhi19"] = "0";
            newRow["Hezhi20"] = "0";
            newRow["Hezhi21"] = "0";
            newRow["Hezhi22"] = "0";
            newRow["Hezhi23"] = "0";
            newRow["Hezhi24"] = "0";
            newRow["Hezhi25"] = "0";
            newRow["Hezhi26"] = "0";
            newRow["Hezhi27"] = "0";
            #endregion
        }
        else if (data >= 61 && data < 66)
        {
            #region
            newRow["Hezhi6"] = data.ToString();
            newRow["Hezhi2"] = "0";
            newRow["Hezhi3"] = "0";
            newRow["Hezhi4"] = "0";
            newRow["Hezhi5"] = "0";
            newRow["Hezhi1"] = "0";
            newRow["Hezhi7"] = "0";
            newRow["Hezhi8"] = "0";
            newRow["Hezhi9"] = "0";
            newRow["Hezhi10"] = "0";
            newRow["Hezhi11"] = "0";
            newRow["Hezhi12"] = "0";
            newRow["Hezhi13"] = "0";
            newRow["Hezhi14"] = "0";
            newRow["Hezhi15"] = "0";
            newRow["Hezhi16"] = "0";
            newRow["Hezhi17"] = "0";
            newRow["Hezhi18"] = "0";
            newRow["Hezhi19"] = "0";
            newRow["Hezhi20"] = "0";
            newRow["Hezhi21"] = "0";
            newRow["Hezhi22"] = "0";
            newRow["Hezhi23"] = "0";
            newRow["Hezhi24"] = "0";
            newRow["Hezhi25"] = "0";
            newRow["Hezhi26"] = "0";
            newRow["Hezhi27"] = "0";
            #endregion
        }
        else if (data >= 66 && data < 71)
        {
            #region
            newRow["Hezhi7"] = data.ToString();
            newRow["Hezhi2"] = "0";
            newRow["Hezhi3"] = "0";
            newRow["Hezhi4"] = "0";
            newRow["Hezhi5"] = "0";
            newRow["Hezhi6"] = "0";
            newRow["Hezhi1"] = "0";
            newRow["Hezhi8"] = "0";
            newRow["Hezhi9"] = "0";
            newRow["Hezhi10"] = "0";
            newRow["Hezhi11"] = "0";
            newRow["Hezhi12"] = "0";
            newRow["Hezhi13"] = "0";
            newRow["Hezhi14"] = "0";
            newRow["Hezhi15"] = "0";
            newRow["Hezhi16"] = "0";
            newRow["Hezhi17"] = "0";
            newRow["Hezhi18"] = "0";
            newRow["Hezhi19"] = "0";
            newRow["Hezhi20"] = "0";
            newRow["Hezhi21"] = "0";
            newRow["Hezhi22"] = "0";
            newRow["Hezhi23"] = "0";
            newRow["Hezhi24"] = "0";
            newRow["Hezhi25"] = "0";
            newRow["Hezhi26"] = "0";
            newRow["Hezhi27"] = "0";
            #endregion
        }
        else if (data >= 71 && data < 76)
        {
            #region
            newRow["Hezhi8"] = data.ToString();
            newRow["Hezhi2"] = "0";
            newRow["Hezhi3"] = "0";
            newRow["Hezhi4"] = "0";
            newRow["Hezhi5"] = "0";
            newRow["Hezhi6"] = "0";
            newRow["Hezhi7"] = "0";
            newRow["Hezhi1"] = "0";
            newRow["Hezhi9"] = "0";
            newRow["Hezhi10"] = "0";
            newRow["Hezhi11"] = "0";
            newRow["Hezhi12"] = "0";
            newRow["Hezhi13"] = "0";
            newRow["Hezhi14"] = "0";
            newRow["Hezhi15"] = "0";
            newRow["Hezhi16"] = "0";
            newRow["Hezhi17"] = "0";
            newRow["Hezhi18"] = "0";
            newRow["Hezhi19"] = "0";
            newRow["Hezhi20"] = "0";
            newRow["Hezhi21"] = "0";
            newRow["Hezhi22"] = "0";
            newRow["Hezhi23"] = "0";
            newRow["Hezhi24"] = "0";
            newRow["Hezhi25"] = "0";
            newRow["Hezhi26"] = "0";
            newRow["Hezhi27"] = "0";
            #endregion
        }
        else if (data >= 76 && data < 81)
        {
            #region
            newRow["Hezhi9"] = data.ToString();
            newRow["Hezhi2"] = "0";
            newRow["Hezhi3"] = "0";
            newRow["Hezhi4"] = "0";
            newRow["Hezhi5"] = "0";
            newRow["Hezhi6"] = "0";
            newRow["Hezhi7"] = "0";
            newRow["Hezhi8"] = "0";
            newRow["Hezhi1"] = "0";
            newRow["Hezhi10"] = "0";
            newRow["Hezhi11"] = "0";
            newRow["Hezhi12"] = "0";
            newRow["Hezhi13"] = "0";
            newRow["Hezhi14"] = "0";
            newRow["Hezhi15"] = "0";
            newRow["Hezhi16"] = "0";
            newRow["Hezhi17"] = "0";
            newRow["Hezhi18"] = "0";
            newRow["Hezhi19"] = "0";
            newRow["Hezhi20"] = "0";
            newRow["Hezhi21"] = "0";
            newRow["Hezhi22"] = "0";
            newRow["Hezhi23"] = "0";
            newRow["Hezhi24"] = "0";
            newRow["Hezhi25"] = "0";
            newRow["Hezhi26"] = "0";
            newRow["Hezhi27"] = "0";
            #endregion
        }
        else if (data >= 81 && data < 86)
        {
            #region
            newRow["Hezhi10"] = data.ToString();
            newRow["Hezhi2"] = "0";
            newRow["Hezhi3"] = "0";
            newRow["Hezhi4"] = "0";
            newRow["Hezhi5"] = "0";
            newRow["Hezhi6"] = "0";
            newRow["Hezhi7"] = "0";
            newRow["Hezhi8"] = "0";
            newRow["Hezhi9"] = "0";
            newRow["Hezhi1"] = "0";
            newRow["Hezhi11"] = "0";
            newRow["Hezhi12"] = "0";
            newRow["Hezhi13"] = "0";
            newRow["Hezhi14"] = "0";
            newRow["Hezhi15"] = "0";
            newRow["Hezhi16"] = "0";
            newRow["Hezhi17"] = "0";
            newRow["Hezhi18"] = "0";
            newRow["Hezhi19"] = "0";
            newRow["Hezhi20"] = "0";
            newRow["Hezhi21"] = "0";
            newRow["Hezhi22"] = "0";
            newRow["Hezhi23"] = "0";
            newRow["Hezhi24"] = "0";
            newRow["Hezhi25"] = "0";
            newRow["Hezhi26"] = "0";
            newRow["Hezhi27"] = "0";
            #endregion
        }
        else if (data >= 86 && data < 91)
        {
            #region
            newRow["Hezhi11"] = data.ToString();
            newRow["Hezhi2"] = "0";
            newRow["Hezhi3"] = "0";
            newRow["Hezhi4"] = "0";
            newRow["Hezhi5"] = "0";
            newRow["Hezhi6"] = "0";
            newRow["Hezhi7"] = "0";
            newRow["Hezhi8"] = "0";
            newRow["Hezhi9"] = "0";
            newRow["Hezhi10"] = "0";
            newRow["Hezhi1"] = "0";
            newRow["Hezhi12"] = "0";
            newRow["Hezhi13"] = "0";
            newRow["Hezhi14"] = "0";
            newRow["Hezhi15"] = "0";
            newRow["Hezhi16"] = "0";
            newRow["Hezhi17"] = "0";
            newRow["Hezhi18"] = "0";
            newRow["Hezhi19"] = "0";
            newRow["Hezhi20"] = "0";
            newRow["Hezhi21"] = "0";
            newRow["Hezhi22"] = "0";
            newRow["Hezhi23"] = "0";
            newRow["Hezhi24"] = "0";
            newRow["Hezhi25"] = "0";
            newRow["Hezhi26"] = "0";
            newRow["Hezhi27"] = "0";
            #endregion
        }
        else if (data >= 91 && data < 96)
        {
            #region
            newRow["Hezhi12"] = data.ToString();
            newRow["Hezhi2"] = "0";
            newRow["Hezhi3"] = "0";
            newRow["Hezhi4"] = "0";
            newRow["Hezhi5"] = "0";
            newRow["Hezhi6"] = "0";
            newRow["Hezhi7"] = "0";
            newRow["Hezhi8"] = "0";
            newRow["Hezhi9"] = "0";
            newRow["Hezhi10"] = "0";
            newRow["Hezhi11"] = "0";
            newRow["Hezhi1"] = "0";
            newRow["Hezhi13"] = "0";
            newRow["Hezhi14"] = "0";
            newRow["Hezhi15"] = "0";
            newRow["Hezhi16"] = "0";
            newRow["Hezhi17"] = "0";
            newRow["Hezhi18"] = "0";
            newRow["Hezhi19"] = "0";
            newRow["Hezhi20"] = "0";
            newRow["Hezhi21"] = "0";
            newRow["Hezhi22"] = "0";
            newRow["Hezhi23"] = "0";
            newRow["Hezhi24"] = "0";
            newRow["Hezhi25"] = "0";
            newRow["Hezhi26"] = "0";
            newRow["Hezhi27"] = "0";
            #endregion
        }
        else if (data >= 96 && data < 101)
        {
            #region
            newRow["Hezhi13"] = data.ToString();
            newRow["Hezhi2"] = "0";
            newRow["Hezhi3"] = "0";
            newRow["Hezhi4"] = "0";
            newRow["Hezhi5"] = "0";
            newRow["Hezhi6"] = "0";
            newRow["Hezhi7"] = "0";
            newRow["Hezhi8"] = "0";
            newRow["Hezhi9"] = "0";
            newRow["Hezhi10"] = "0";
            newRow["Hezhi11"] = "0";
            newRow["Hezhi12"] = "0";
            newRow["Hezhi1"] = "0";
            newRow["Hezhi14"] = "0";
            newRow["Hezhi15"] = "0";
            newRow["Hezhi16"] = "0";
            newRow["Hezhi17"] = "0";
            newRow["Hezhi18"] = "0";
            newRow["Hezhi19"] = "0";
            newRow["Hezhi20"] = "0";
            newRow["Hezhi21"] = "0";
            newRow["Hezhi22"] = "0";
            newRow["Hezhi23"] = "0";
            newRow["Hezhi24"] = "0";
            newRow["Hezhi25"] = "0";
            newRow["Hezhi26"] = "0";
            newRow["Hezhi27"] = "0";
            #endregion
        }
        else if (data >= 101 && data < 106)
        {
            #region
            newRow["Hezhi14"] = data.ToString();
            newRow["Hezhi2"] = "0";
            newRow["Hezhi3"] = "0";
            newRow["Hezhi4"] = "0";
            newRow["Hezhi5"] = "0";
            newRow["Hezhi6"] = "0";
            newRow["Hezhi7"] = "0";
            newRow["Hezhi8"] = "0";
            newRow["Hezhi9"] = "0";
            newRow["Hezhi10"] = "0";
            newRow["Hezhi11"] = "0";
            newRow["Hezhi12"] = "0";
            newRow["Hezhi13"] = "0";
            newRow["Hezhi1"] = "0";
            newRow["Hezhi15"] = "0";
            newRow["Hezhi16"] = "0";
            newRow["Hezhi17"] = "0";
            newRow["Hezhi18"] = "0";
            newRow["Hezhi19"] = "0";
            newRow["Hezhi20"] = "0";
            newRow["Hezhi21"] = "0";
            newRow["Hezhi22"] = "0";
            newRow["Hezhi23"] = "0";
            newRow["Hezhi24"] = "0";
            newRow["Hezhi25"] = "0";
            newRow["Hezhi26"] = "0";
            newRow["Hezhi27"] = "0";
            #endregion
        }
        else if (data >= 106 && data < 111)
        {
            #region
            newRow["Hezhi15"] = data.ToString();
            newRow["Hezhi2"] = "0";
            newRow["Hezhi3"] = "0";
            newRow["Hezhi4"] = "0";
            newRow["Hezhi5"] = "0";
            newRow["Hezhi6"] = "0";
            newRow["Hezhi7"] = "0";
            newRow["Hezhi8"] = "0";
            newRow["Hezhi9"] = "0";
            newRow["Hezhi10"] = "0";
            newRow["Hezhi11"] = "0";
            newRow["Hezhi12"] = "0";
            newRow["Hezhi13"] = "0";
            newRow["Hezhi14"] = "0";
            newRow["Hezhi1"] = "0";
            newRow["Hezhi16"] = "0";
            newRow["Hezhi17"] = "0";
            newRow["Hezhi18"] = "0";
            newRow["Hezhi19"] = "0";
            newRow["Hezhi20"] = "0";
            newRow["Hezhi21"] = "0";
            newRow["Hezhi22"] = "0";
            newRow["Hezhi23"] = "0";
            newRow["Hezhi24"] = "0";
            newRow["Hezhi25"] = "0";
            newRow["Hezhi26"] = "0";
            newRow["Hezhi27"] = "0";
            #endregion
        }
        else if (data >= 111 && data < 116)
        {
            #region
            newRow["hezhi16"] = data.ToString();
            newRow["Hezhi2"] = "0";
            newRow["Hezhi3"] = "0";
            newRow["Hezhi4"] = "0";
            newRow["Hezhi5"] = "0";
            newRow["Hezhi6"] = "0";
            newRow["Hezhi7"] = "0";
            newRow["Hezhi8"] = "0";
            newRow["Hezhi9"] = "0";
            newRow["Hezhi10"] = "0";
            newRow["Hezhi11"] = "0";
            newRow["Hezhi12"] = "0";
            newRow["Hezhi13"] = "0";
            newRow["Hezhi14"] = "0";
            newRow["Hezhi15"] = "0";
            newRow["Hezhi1"] = "0";
            newRow["Hezhi17"] = "0";
            newRow["Hezhi18"] = "0";
            newRow["Hezhi19"] = "0";
            newRow["Hezhi20"] = "0";
            newRow["Hezhi21"] = "0";
            newRow["Hezhi22"] = "0";
            newRow["Hezhi23"] = "0";
            newRow["Hezhi24"] = "0";
            newRow["Hezhi25"] = "0";
            newRow["Hezhi26"] = "0";
            newRow["Hezhi27"] = "0";
            #endregion
        }
        else if (data >= 116 && data < 121)
        {
            #region
            newRow["hezhi17"] = data.ToString();
            newRow["Hezhi2"] = "0";
            newRow["Hezhi3"] = "0";
            newRow["Hezhi4"] = "0";
            newRow["Hezhi5"] = "0";
            newRow["Hezhi6"] = "0";
            newRow["Hezhi7"] = "0";
            newRow["Hezhi8"] = "0";
            newRow["Hezhi9"] = "0";
            newRow["Hezhi10"] = "0";
            newRow["Hezhi11"] = "0";
            newRow["Hezhi12"] = "0";
            newRow["Hezhi13"] = "0";
            newRow["Hezhi14"] = "0";
            newRow["Hezhi15"] = "0";
            newRow["Hezhi16"] = "0";
            newRow["Hezhi1"] = "0";
            newRow["Hezhi18"] = "0";
            newRow["Hezhi19"] = "0";
            newRow["Hezhi20"] = "0";
            newRow["Hezhi21"] = "0";
            newRow["Hezhi22"] = "0";
            newRow["Hezhi23"] = "0";
            newRow["Hezhi24"] = "0";
            newRow["Hezhi25"] = "0";
            newRow["Hezhi26"] = "0";
            newRow["Hezhi27"] = "0";
            #endregion
        }
        else if (data >= 121 && data < 126)
        {
            #region
            newRow["hezhi18"] = data.ToString();
            newRow["Hezhi2"] = "0";
            newRow["Hezhi3"] = "0";
            newRow["Hezhi4"] = "0";
            newRow["Hezhi5"] = "0";
            newRow["Hezhi6"] = "0";
            newRow["Hezhi7"] = "0";
            newRow["Hezhi8"] = "0";
            newRow["Hezhi9"] = "0";
            newRow["Hezhi10"] = "0";
            newRow["Hezhi11"] = "0";
            newRow["Hezhi12"] = "0";
            newRow["Hezhi13"] = "0";
            newRow["Hezhi14"] = "0";
            newRow["Hezhi15"] = "0";
            newRow["Hezhi16"] = "0";
            newRow["Hezhi17"] = "0";
            newRow["Hezhi1"] = "0";
            newRow["Hezhi19"] = "0";
            newRow["Hezhi20"] = "0";
            newRow["Hezhi21"] = "0";
            newRow["Hezhi22"] = "0";
            newRow["Hezhi23"] = "0";
            newRow["Hezhi24"] = "0";
            newRow["Hezhi25"] = "0";
            newRow["Hezhi26"] = "0";
            newRow["Hezhi27"] = "0";
            #endregion
        }
        else if (data >= 126 && data < 131)
        {
            #region
            newRow["hezhi19"] = data.ToString();
            newRow["Hezhi2"] = "0";
            newRow["Hezhi3"] = "0";
            newRow["Hezhi4"] = "0";
            newRow["Hezhi5"] = "0";
            newRow["Hezhi6"] = "0";
            newRow["Hezhi7"] = "0";
            newRow["Hezhi8"] = "0";
            newRow["Hezhi9"] = "0";
            newRow["Hezhi10"] = "0";
            newRow["Hezhi11"] = "0";
            newRow["Hezhi12"] = "0";
            newRow["Hezhi13"] = "0";
            newRow["Hezhi14"] = "0";
            newRow["Hezhi15"] = "0";
            newRow["Hezhi16"] = "0";
            newRow["Hezhi17"] = "0";
            newRow["Hezhi18"] = "0";
            newRow["Hezhi1"] = "0";
            newRow["Hezhi20"] = "0";
            newRow["Hezhi21"] = "0";
            newRow["Hezhi22"] = "0";
            newRow["Hezhi23"] = "0";
            newRow["Hezhi24"] = "0";
            newRow["Hezhi25"] = "0";
            newRow["Hezhi26"] = "0";
            newRow["Hezhi27"] = "0";
            #endregion
        }
        else if (data >= 131 && data < 136)
        {
            #region
            newRow["hezhi20"] = data.ToString();
            newRow["Hezhi2"] = "0";
            newRow["Hezhi3"] = "0";
            newRow["Hezhi4"] = "0";
            newRow["Hezhi5"] = "0";
            newRow["Hezhi6"] = "0";
            newRow["Hezhi7"] = "0";
            newRow["Hezhi8"] = "0";
            newRow["Hezhi9"] = "0";
            newRow["Hezhi10"] = "0";
            newRow["Hezhi11"] = "0";
            newRow["Hezhi12"] = "0";
            newRow["Hezhi13"] = "0";
            newRow["Hezhi14"] = "0";
            newRow["Hezhi15"] = "0";
            newRow["Hezhi16"] = "0";
            newRow["Hezhi17"] = "0";
            newRow["Hezhi18"] = "0";
            newRow["Hezhi19"] = "0";
            newRow["Hezhi1"] = "0";
            newRow["Hezhi21"] = "0";
            newRow["Hezhi22"] = "0";
            newRow["Hezhi23"] = "0";
            newRow["Hezhi24"] = "0";
            newRow["Hezhi25"] = "0";
            newRow["Hezhi26"] = "0";
            newRow["Hezhi27"] = "0";
            #endregion
        }
        else if (data >= 136 && data < 141)
        {
            #region
            newRow["hezhi21"] = data.ToString();
            newRow["Hezhi2"] = "0";
            newRow["Hezhi3"] = "0";
            newRow["Hezhi4"] = "0";
            newRow["Hezhi5"] = "0";
            newRow["Hezhi6"] = "0";
            newRow["Hezhi7"] = "0";
            newRow["Hezhi8"] = "0";
            newRow["Hezhi9"] = "0";
            newRow["Hezhi10"] = "0";
            newRow["Hezhi11"] = "0";
            newRow["Hezhi12"] = "0";
            newRow["Hezhi13"] = "0";
            newRow["Hezhi14"] = "0";
            newRow["Hezhi15"] = "0";
            newRow["Hezhi16"] = "0";
            newRow["Hezhi17"] = "0";
            newRow["Hezhi18"] = "0";
            newRow["Hezhi19"] = "0";
            newRow["Hezhi20"] = "0";
            newRow["Hezhi1"] = "0";
            newRow["Hezhi22"] = "0";
            newRow["Hezhi23"] = "0";
            newRow["Hezhi24"] = "0";
            newRow["Hezhi25"] = "0";
            newRow["Hezhi26"] = "0";
            newRow["Hezhi27"] = "0";
            #endregion
        }
        else if (data >= 141 && data < 146)
        {
            #region
            newRow["hezhi22"] = data.ToString();
            newRow["Hezhi2"] = "0";
            newRow["Hezhi3"] = "0";
            newRow["Hezhi4"] = "0";
            newRow["Hezhi5"] = "0";
            newRow["Hezhi6"] = "0";
            newRow["Hezhi7"] = "0";
            newRow["Hezhi8"] = "0";
            newRow["Hezhi9"] = "0";
            newRow["Hezhi10"] = "0";
            newRow["Hezhi11"] = "0";
            newRow["Hezhi12"] = "0";
            newRow["Hezhi13"] = "0";
            newRow["Hezhi14"] = "0";
            newRow["Hezhi15"] = "0";
            newRow["Hezhi16"] = "0";
            newRow["Hezhi17"] = "0";
            newRow["Hezhi18"] = "0";
            newRow["Hezhi19"] = "0";
            newRow["Hezhi20"] = "0";
            newRow["Hezhi21"] = "0";
            newRow["Hezhi1"] = "0";
            newRow["Hezhi23"] = "0";
            newRow["Hezhi24"] = "0";
            newRow["Hezhi25"] = "0";
            newRow["Hezhi26"] = "0";
            newRow["Hezhi27"] = "0";
            #endregion
        }
        else if (data >= 146 && data < 151)
        {
            #region
            newRow["hezhi23"] = data.ToString();
            newRow["Hezhi2"] = "0";
            newRow["Hezhi3"] = "0";
            newRow["Hezhi4"] = "0";
            newRow["Hezhi5"] = "0";
            newRow["Hezhi6"] = "0";
            newRow["Hezhi7"] = "0";
            newRow["Hezhi8"] = "0";
            newRow["Hezhi9"] = "0";
            newRow["Hezhi10"] = "0";
            newRow["Hezhi11"] = "0";
            newRow["Hezhi12"] = "0";
            newRow["Hezhi13"] = "0";
            newRow["Hezhi14"] = "0";
            newRow["Hezhi15"] = "0";
            newRow["Hezhi16"] = "0";
            newRow["Hezhi17"] = "0";
            newRow["Hezhi18"] = "0";
            newRow["Hezhi19"] = "0";
            newRow["Hezhi20"] = "0";
            newRow["Hezhi21"] = "0";
            newRow["Hezhi22"] = "0";
            newRow["Hezhi1"] = "0";
            newRow["Hezhi24"] = "0";
            newRow["Hezhi25"] = "0";
            newRow["Hezhi26"] = "0";
            newRow["Hezhi27"] = "0";
            #endregion
        }
        else if (data >= 151 && data < 156)
        {
            #region
            newRow["hezhi24"] = data.ToString();
            newRow["Hezhi2"] = "0";
            newRow["Hezhi3"] = "0";
            newRow["Hezhi4"] = "0";
            newRow["Hezhi5"] = "0";
            newRow["Hezhi6"] = "0";
            newRow["Hezhi7"] = "0";
            newRow["Hezhi8"] = "0";
            newRow["Hezhi9"] = "0";
            newRow["Hezhi10"] = "0";
            newRow["Hezhi11"] = "0";
            newRow["Hezhi12"] = "0";
            newRow["Hezhi13"] = "0";
            newRow["Hezhi14"] = "0";
            newRow["Hezhi15"] = "0";
            newRow["Hezhi16"] = "0";
            newRow["Hezhi17"] = "0";
            newRow["Hezhi18"] = "0";
            newRow["Hezhi19"] = "0";
            newRow["Hezhi20"] = "0";
            newRow["Hezhi21"] = "0";
            newRow["Hezhi22"] = "0";
            newRow["Hezhi23"] = "0";
            newRow["Hezhi1"] = "0";
            newRow["Hezhi25"] = "0";
            newRow["Hezhi26"] = "0";
            newRow["Hezhi27"] = "0";
            #endregion
        }
        else if (data >= 156 && data < 161)
        {
            #region
            newRow["hezhi25"] = data.ToString();
            newRow["Hezhi2"] = "0";
            newRow["Hezhi3"] = "0";
            newRow["Hezhi4"] = "0";
            newRow["Hezhi5"] = "0";
            newRow["Hezhi6"] = "0";
            newRow["Hezhi7"] = "0";
            newRow["Hezhi8"] = "0";
            newRow["Hezhi9"] = "0";
            newRow["Hezhi10"] = "0";
            newRow["Hezhi11"] = "0";
            newRow["Hezhi12"] = "0";
            newRow["Hezhi13"] = "0";
            newRow["Hezhi14"] = "0";
            newRow["Hezhi15"] = "0";
            newRow["Hezhi16"] = "0";
            newRow["Hezhi17"] = "0";
            newRow["Hezhi18"] = "0";
            newRow["Hezhi19"] = "0";
            newRow["Hezhi20"] = "0";
            newRow["Hezhi21"] = "0";
            newRow["Hezhi22"] = "0";
            newRow["Hezhi23"] = "0";
            newRow["Hezhi24"] = "0";
            newRow["Hezhi1"] = "0";
            newRow["Hezhi26"] = "0";
            newRow["Hezhi27"] = "0";
            #endregion
        }
        else if (data > 161 && data < 166)
        {
            #region
            newRow["hezhi26"] = data.ToString();
            newRow["Hezhi2"] = "0";
            newRow["Hezhi3"] = "0";
            newRow["Hezhi4"] = "0";
            newRow["Hezhi5"] = "0";
            newRow["Hezhi6"] = "0";
            newRow["Hezhi7"] = "0";
            newRow["Hezhi8"] = "0";
            newRow["Hezhi9"] = "0";
            newRow["Hezhi10"] = "0";
            newRow["Hezhi11"] = "0";
            newRow["Hezhi12"] = "0";
            newRow["Hezhi13"] = "0";
            newRow["Hezhi14"] = "0";
            newRow["Hezhi15"] = "0";
            newRow["Hezhi16"] = "0";
            newRow["Hezhi17"] = "0";
            newRow["Hezhi18"] = "0";
            newRow["Hezhi19"] = "0";
            newRow["Hezhi20"] = "0";
            newRow["Hezhi21"] = "0";
            newRow["Hezhi22"] = "0";
            newRow["Hezhi23"] = "0";
            newRow["Hezhi24"] = "0";
            newRow["Hezhi25"] = "0";
            newRow["Hezhi1"] = "0";
            newRow["Hezhi27"] = "0";
            #endregion
        }
        else if (data >= 166)
        {
            #region
            newRow["hezhi27"] = data.ToString();
            newRow["Hezhi2"] = "0";
            newRow["Hezhi3"] = "0";
            newRow["Hezhi4"] = "0";
            newRow["Hezhi5"] = "0";
            newRow["Hezhi6"] = "0";
            newRow["Hezhi7"] = "0";
            newRow["Hezhi8"] = "0";
            newRow["Hezhi9"] = "0";
            newRow["Hezhi10"] = "0";
            newRow["Hezhi11"] = "0";
            newRow["Hezhi12"] = "0";
            newRow["Hezhi13"] = "0";
            newRow["Hezhi14"] = "0";
            newRow["Hezhi15"] = "0";
            newRow["Hezhi16"] = "0";
            newRow["Hezhi17"] = "0";
            newRow["Hezhi18"] = "0";
            newRow["Hezhi19"] = "0";
            newRow["Hezhi20"] = "0";
            newRow["Hezhi21"] = "0";
            newRow["Hezhi22"] = "0";
            newRow["Hezhi23"] = "0";
            newRow["Hezhi24"] = "0";
            newRow["Hezhi25"] = "0";
            newRow["Hezhi26"] = "0";
            newRow["Hezhi1"] = "0";
            #endregion
        }
        dtPaperList.Rows.Add(newRow);
    }

    protected void Button1_Click(object sender, EventArgs e)
    {
        jinqiCount = int.Parse(DropDownList1.SelectedValue);
        bindData(int.Parse(DropDownList1.SelectedValue));
    }
    protected int[] TiaoxingDT = new int[27];
    /// <summary>
    /// 绑定条形码
    /// </summary>
    /// <param name="data">和值</param>
    /// <param name="datalast">和值尾数</param>
    protected void bindTiaoxing(int data, int datalast)
    {
        if (data < 40)
        {
            TiaoxingDT[0] += 1;
        }
        else if (data >= 41 && data < 46)
        {
            TiaoxingDT[1] += 1;
        }
        else if (data >= 46 && data < 51)
        {
            TiaoxingDT[2] += 1;
        }
        else if (data >= 51 && data < 56)
        {
            TiaoxingDT[3] += 1;
        }
        else if (data >= 56 && data < 61)
        {
            TiaoxingDT[4] += 1;
        }
        else if (data >= 61 && data < 66)
        {
            TiaoxingDT[5] += 1;
        }
        else if (data >= 66 && data < 71)
        {
            TiaoxingDT[6] += 1;
        }
        else if (data >= 71 && data < 76)
        {
            TiaoxingDT[7] += 1;
        }
        else if (data >= 76 && data < 81)
        {
            TiaoxingDT[8] += 1;
        }
        else if (data >= 81 && data < 86)
        {
            TiaoxingDT[9] += 1;
        }
        else if (data >= 86 && data < 91)
        {
            TiaoxingDT[10] += 1;
        }
        else if (data >= 91 && data < 96)
        {
            TiaoxingDT[11] += 1;
        }
        else if (data >= 96 && data < 101)
        {
            TiaoxingDT[12] += 1;
        }
        else if (data >= 101 && data < 106)
        {
            TiaoxingDT[13] += 1;
        }
        else if (data >= 106 && data < 111)
        {
            TiaoxingDT[14] += 1;
        }
        else if(data>=111 && data<116)
        {
            TiaoxingDT[15] += 1;
        }
        else if(data>=116 && data<121)
        {
            TiaoxingDT[16] += 1;
        }
        else if(data >=121 && data<126)
        {
            TiaoxingDT[17] += 1;
        }
        else if(data>=126 && data<131)
        {
            TiaoxingDT[18] += 1;
        }
        else if(data>=131 && data<136)
        {
            TiaoxingDT[19] += 1;
        }
        else if(data>=136 && data<141)
        {
            TiaoxingDT[20] += 1;
        }
        else if(data>=141 && data<146)
        {
            TiaoxingDT[21] += 1;
        }
        else if(data>=146 && data<151)
        {
            TiaoxingDT[22] += 1;
        }
        else if(data>=151 && data<156)
        {
            TiaoxingDT[23] += 1;
        }
        else if(data>=156 && data<161)
        {
            TiaoxingDT[24] += 1;
        }
        else if(data>=161 && data<166)
        {
            TiaoxingDT[25] += 1;
        }
        else if(data>=166)
        {
            TiaoxingDT[26] += 1;
        }

    }
}